/*
============================================================================
 Name        : sd_network.h
 Author      : Jian
 Version     :
 Copyright   : GPL
 Description : sd_network.h - header file
============================================================================
*/

#ifndef SD_NETWORK_H
#define SD_NETWORK_H

/* INCLUDES */
#include "dd_define.h"

__DD_BEGIN_DECLS

/* tcp socket functions, 
* all that is block function 
* all the format of ip and port is little edian
*/
sd_socket* sd_tcp_open(int noDelay, int quickAck) ;

void sd_tcp_close(sd_socket* sock) ;

int sd_tcp_connect(sd_socket* sock, DD_UINT ip, DD_UINT port) ;

int sd_tcp_send(sd_socket* sock, void* data, int len) ;

int sd_tcp_recv(sd_socket* sock, void* data, int len) ;

/* get ip from dns */
int sd_get_host_ip(const char* host, DD_UINT* ip) ;


__DD_END_DECLS

#endif  /* SD_NETWORK_H */

/* End of File */
